summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xAndroid.mk70
-rw-r--r--crypto/ext4crypt/Android.mk6
-rw-r--r--crypto/ext4crypt/Decrypt.cpp33
-rw-r--r--crypto/ext4crypt/HashPassword.cpp33
-rw-r--r--crypto/ext4crypt/HashPassword.h8
-rw-r--r--crypto/scrypt/Scrypt.mk12
-rwxr-xr-xdata.cpp2
-rw-r--r--etc/init.recovery.logd.rc17
-rw-r--r--fb2png/fb.c1
-rw-r--r--fb2png/img_process.c16
-rw-r--r--fb2png/log.h4
-rwxr-xr-xgui/action.cpp70
-rw-r--r--gui/objects.hpp1
-rwxr-xr-xgui/theme/common/landscape.xml12
-rwxr-xr-xgui/theme/common/languages/en.xml5
-rw-r--r--gui/theme/common/languages/ru.xml203
-rwxr-xr-xgui/theme/common/portrait.xml16
-rwxr-xr-xgui/theme/common/watch.xml12
-rw-r--r--gui/theme/extra-languages/languages/zh_CN.xml34
-rw-r--r--gui/theme/extra-languages/languages/zh_TW.xml34
-rw-r--r--minui/Android.mk6
-rw-r--r--minuitwrp/Android.mk6
-rw-r--r--orscmd/orscmd.cpp6
-rw-r--r--partition.cpp22
-rwxr-xr-xpartitionmanager.cpp35
-rw-r--r--prebuilt/Android.mk24
-rw-r--r--scripts/language_helper.py4
-rw-r--r--toolbox/Android.mk37
-rw-r--r--toybox/Android.mk33
-rwxr-xr-xtwinstall.cpp6
-rwxr-xr-xtwrp-functions.cpp19
-rwxr-xr-xtwrp-functions.hpp1
-rwxr-xr-xtwrpDigestDriver.cpp2
-rw-r--r--variables.h2
34 files changed, 572 insertions, 220 deletions
diff --git a/Android.mk b/Android.mk
index a25224428..7ffcd70aa 100755
--- a/Android.mk
+++ b/Android.mk
@@ -190,7 +190,7 @@ LOCAL_SHARED_LIBRARIES += libselinux
ifeq ($(AB_OTA_UPDATER),true)
LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
LOCAL_SHARED_LIBRARIES += libhardware android.hardware.boot@1.0
- LOCAL_REQUIRED_MODULES += libhardware
+ TWRP_REQUIRED_MODULES += libhardware
endif
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
@@ -398,7 +398,7 @@ endif
ifneq ($(TW_CLOCK_OFFSET),)
LOCAL_CFLAGS += -DTW_CLOCK_OFFSET=$(TW_CLOCK_OFFSET)
endif
-LOCAL_REQUIRED_MODULES += \
+TWRP_REQUIRED_MODULES += \
dump_image \
erase_image \
flash_image \
@@ -433,72 +433,72 @@ ifneq ($(TW_USE_TOOLBOX), true)
endif
else
ifneq ($(wildcard external/toybox/Android.mk),)
- LOCAL_REQUIRED_MODULES += toybox_symlinks
+ TWRP_REQUIRED_MODULES += toybox_symlinks
endif
ifneq ($(wildcard external/zip/Android.mk),)
- LOCAL_REQUIRED_MODULES += zip
+ TWRP_REQUIRED_MODULES += zip
endif
ifneq ($(wildcard external/unzip/Android.mk),)
- LOCAL_REQUIRED_MODULES += unzip
+ TWRP_REQUIRED_MODULES += unzip
endif
endif
ifneq ($(TW_NO_EXFAT), true)
- LOCAL_REQUIRED_MODULES += mkexfatfs fsckexfat
+ TWRP_REQUIRED_MODULES += mkexfatfs fsckexfat
ifneq ($(TW_NO_EXFAT_FUSE), true)
- LOCAL_REQUIRED_MODULES += exfat-fuse
+ TWRP_REQUIRED_MODULES += exfat-fuse
endif
endif
ifeq ($(BOARD_HAS_NO_REAL_SDCARD),)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
- LOCAL_REQUIRED_MODULES += sgdisk
+ TWRP_REQUIRED_MODULES += sgdisk
else
- LOCAL_REQUIRED_MODULES += sgdisk_static
+ TWRP_REQUIRED_MODULES += sgdisk_static
endif
endif
ifneq ($(TW_EXCLUDE_ENCRYPTED_BACKUPS), true)
- LOCAL_REQUIRED_MODULES += openaes openaes_license
+ TWRP_REQUIRED_MODULES += openaes openaes_license
endif
ifeq ($(TW_INCLUDE_DUMLOCK), true)
- LOCAL_REQUIRED_MODULES += \
+ TWRP_REQUIRED_MODULES += \
htcdumlock htcdumlocksys flash_imagesys dump_imagesys libbmlutils.so \
libflashutils.so libmmcutils.so libmtdutils.so HTCDumlock.apk
endif
ifeq ($(TW_INCLUDE_FB2PNG), true)
- LOCAL_REQUIRED_MODULES += fb2png
+ TWRP_REQUIRED_MODULES += fb2png
endif
ifneq ($(TW_OEM_BUILD),true)
- LOCAL_REQUIRED_MODULES += orscmd
+ TWRP_REQUIRED_MODULES += orscmd
endif
ifeq ($(BOARD_USES_BML_OVER_MTD),true)
- LOCAL_REQUIRED_MODULES += bml_over_mtd
+ TWRP_REQUIRED_MODULES += bml_over_mtd
endif
ifeq ($(TW_INCLUDE_INJECTTWRP), true)
- LOCAL_REQUIRED_MODULES += injecttwrp
+ TWRP_REQUIRED_MODULES += injecttwrp
endif
ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true)
- LOCAL_REQUIRED_MODULES += init.recovery.usb.rc
+ TWRP_REQUIRED_MODULES += init.recovery.usb.rc
endif
ifeq ($(TWRP_INCLUDE_LOGCAT), true)
- LOCAL_REQUIRED_MODULES += logcat
+ TWRP_REQUIRED_MODULES += logcat
ifeq ($(TARGET_USES_LOGD), true)
- LOCAL_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
+ TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
endif
endif
# Allow devices to specify device-specific recovery dependencies
ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
- LOCAL_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES)
+ TWRP_REQUIRED_MODULES += $(TARGET_RECOVERY_DEVICE_MODULES)
endif
LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
LOCAL_CFLAGS += -DTWHTCD_PATH=\"$(TWHTCD_PATH)\"
ifeq ($(TW_INCLUDE_NTFS_3G),true)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
- LOCAL_REQUIRED_MODULES += \
+ TWRP_REQUIRED_MODULES += \
mount.ntfs \
fsck.ntfs \
mkfs.ntfs
else
- LOCAL_REQUIRED_MODULES += \
+ TWRP_REQUIRED_MODULES += \
ntfs-3g \
ntfsfix \
mkntfs
@@ -506,23 +506,29 @@ endif
endif
ifeq ($(TARGET_USERIMAGES_USE_F2FS), true)
ifeq ($(shell test $(CM_PLATFORM_SDK_VERSION) -ge 3; echo $$?),0)
- LOCAL_REQUIRED_MODULES += \
+ TWRP_REQUIRED_MODULES += \
fsck.f2fs \
mkfs.f2fs
endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
- LOCAL_REQUIRED_MODULES += sload.f2fs
+ TWRP_REQUIRED_MODULES += sload.f2fs
endif
endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
- LOCAL_REQUIRED_MODULES += file_contexts_text
-else ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0)
- LOCAL_ADDITIONAL_DEPENDENCIES += file_contexts_text
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0)
+ TWRP_REQUIRED_MODULES += file_contexts_text
+endif
+
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
+ ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
+ TWRP_REQUIRED_MODULES += recovery-persist recovery-refresh
+ endif
endif
-ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
-LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES += $(TWRP_REQUIRED_MODULES)
+else
+ LOCAL_ADDITIONAL_DEPENDENCIES += $(TWRP_REQUIRED_MODULES)
endif
include $(BUILD_EXECUTABLE)
@@ -532,7 +538,11 @@ include $(CLEAR_VARS)
LOCAL_MODULE := file_contexts_text
LOCAL_MODULE_TAGS := optional
-LOCAL_REQUIRED_MODULES := file_contexts.bin
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := file_contexts.bin
+else
+ LOCAL_ADDITIONAL_DEPENDENCIES := file_contexts.bin
+endif
LOCAL_POST_INSTALL_CMD := \
$(hide) cp -f $(PRODUCT_OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts
diff --git a/crypto/ext4crypt/Android.mk b/crypto/ext4crypt/Android.mk
index 8e77cdf30..0c6ef5b56 100644
--- a/crypto/ext4crypt/Android.mk
+++ b/crypto/ext4crypt/Android.mk
@@ -45,7 +45,11 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libkeyutils
endif
endif
- LOCAL_REQUIRED_MODULES := keystore_auth
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := keystore_auth
+ else
+ LOCAL_ADDITIONAL_DEPENDENCIES := keystore_auth
+ endif
else
#7.x rules
LOCAL_SRC_FILES += Ext4Crypt.cpp Keymaster.cpp KeyStorage.cpp
diff --git a/crypto/ext4crypt/Decrypt.cpp b/crypto/ext4crypt/Decrypt.cpp
index 3eeaaf877..d8542dca7 100644
--- a/crypto/ext4crypt/Decrypt.cpp
+++ b/crypto/ext4crypt/Decrypt.cpp
@@ -244,13 +244,6 @@ bool Find_Handle(const std::string& spblob_path, std::string& handle_str) {
return false;
}
-// The password data is stored in big endian and has to be swapped on little endian ARM
-template <class T>
-void endianswap(T *objp) {
- unsigned char *memp = reinterpret_cast<unsigned char*>(objp);
- std::reverse(memp, memp + sizeof(T));
-}
-
/* This is the structure of the data in the password data (*.pwd) file which the structure can be found
* https://android.googlesource.com/platform/frameworks/base/+/android-8.0.0_r23/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java#187 */
struct password_data_struct {
@@ -442,7 +435,8 @@ sp<IBinder> getKeystoreBinderRetry() {
namespace keystore {
#define SYNTHETIC_PASSWORD_VERSION_V1 1
-#define SYNTHETIC_PASSWORD_VERSION 2
+#define SYNTHETIC_PASSWORD_VERSION_V2 2
+#define SYNTHETIC_PASSWORD_VERSION_V3 3
#define SYNTHETIC_PASSWORD_PASSWORD_BASED 0
#define SYNTHETIC_PASSWORD_KEY_PREFIX "USRSKEY_synthetic_password_"
#define USR_PRIVATE_KEY_PREFIX "USRPKEY_synthetic_password_"
@@ -579,7 +573,8 @@ std::string unwrapSyntheticPasswordBlob(const std::string& spblob_path, const st
return disk_decryption_secret_key;
}
unsigned char* byteptr = (unsigned char*)spblob_data.data();
- if (*byteptr != SYNTHETIC_PASSWORD_VERSION && *byteptr != SYNTHETIC_PASSWORD_VERSION_V1) {
+ if (*byteptr != SYNTHETIC_PASSWORD_VERSION_V2 && *byteptr != SYNTHETIC_PASSWORD_VERSION_V1
+ && *byteptr != SYNTHETIC_PASSWORD_VERSION_V3) {
printf("Unsupported synthetic password version %i\n", *byteptr);
return disk_decryption_secret_key;
}
@@ -772,9 +767,10 @@ std::string unwrapSyntheticPasswordBlob(const std::string& spblob_path, const st
}
stop_keystore();
return disk_decryption_secret_key;
- } else if (*synthetic_password_version == SYNTHETIC_PASSWORD_VERSION) {
- printf("spblob v2\n");
- /* Version 2 of the spblob is basically the same as version 1, but the order of getting the intermediate key and disk decryption key have been flip-flopped
+ } else if (*synthetic_password_version == SYNTHETIC_PASSWORD_VERSION_V2
+ || *synthetic_password_version == SYNTHETIC_PASSWORD_VERSION_V3) {
+ printf("spblob v2 / v3\n");
+ /* Version 2 / 3 of the spblob is basically the same as version 1, but the order of getting the intermediate key and disk decryption key have been flip-flopped
* as seen in https://android.googlesource.com/platform/frameworks/base/+/5025791ac6d1538224e19189397de8d71dcb1a12
*/
/* First decrypt call found in
@@ -926,7 +922,12 @@ std::string unwrapSyntheticPasswordBlob(const std::string& spblob_path, const st
//printf("secret key: "); output_hex((const unsigned char*)secret_key, secret_key_real_size); printf("\n");
// The payload data from the keystore update is further personalized at https://android.googlesource.com/platform/frameworks/base/+/android-8.0.0_r23/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java#153
// We now have the disk decryption key!
- disk_decryption_secret_key = PersonalizedHash(PERSONALIZATION_FBE_KEY, (const char*)secret_key, secret_key_real_size);
+ if (*synthetic_password_version == SYNTHETIC_PASSWORD_VERSION_V3) {
+ // V3 uses SP800 instead of SHA512
+ disk_decryption_secret_key = PersonalizedHashSP800(PERSONALIZATION_FBE_KEY, PERSONALISATION_CONTEXT, (const char*)secret_key, secret_key_real_size);
+ } else {
+ disk_decryption_secret_key = PersonalizedHash(PERSONALIZATION_FBE_KEY, (const char*)secret_key, secret_key_real_size);
+ }
//printf("disk_decryption_secret_key: '%s'\n", disk_decryption_secret_key.c_str());
free(secret_key);
return disk_decryption_secret_key;
@@ -1336,7 +1337,11 @@ bool Decrypt_User(const userid_t user_id, const std::string& Password) {
printf("e4crypt_unlock_user_key returned fail\n");
return false;
}
- if (!e4crypt_prepare_user_storage(nullptr, user_id, 0, flags)) {
+#ifdef USE_KEYSTORAGE_4
+ if (!e4crypt_prepare_user_storage("", user_id, 0, flags)) {
+#else
+ if (!e4crypt_prepare_user_storage(nullptr, user_id, 0, flags)) {
+#endif
printf("failed to e4crypt_prepare_user_storage\n");
return false;
}
diff --git a/crypto/ext4crypt/HashPassword.cpp b/crypto/ext4crypt/HashPassword.cpp
index 817c984bd..07ecb1f7d 100644
--- a/crypto/ext4crypt/HashPassword.cpp
+++ b/crypto/ext4crypt/HashPassword.cpp
@@ -27,11 +27,13 @@
#include <string>
#include <stdlib.h>
#include <openssl/sha.h>
+#include <openssl/hmac.h>
#include "HashPassword.h"
#define PASS_PADDING_SIZE 128
#define SHA512_HEX_SIZE SHA512_DIGEST_LENGTH * 2
+#define SHA256_HEX_SIZE SHA256_DIGEST_LENGTH * 2
void* PersonalizedHashBinary(const char* prefix, const char* key, const size_t key_size) {
size_t size = PASS_PADDING_SIZE + key_size;
@@ -78,6 +80,37 @@ std::string PersonalizedHash(const char* prefix, const std::string& Password) {
return PersonalizedHash(prefix, Password.c_str(), Password.size());
}
+std::string PersonalizedHashSP800(const char* label, const char* context, const char* key, const size_t key_size) {
+ HMAC_CTX ctx;
+ HMAC_CTX_init(&ctx);
+ HMAC_Init_ex(&ctx, key, key_size, EVP_sha256(), NULL);
+ unsigned int counter = 1;
+ endianswap(&counter);
+ HMAC_Update(&ctx, (const unsigned char*)&counter, 4);
+ HMAC_Update(&ctx, (const unsigned char*)label, strlen(label));
+ const unsigned char divider = 0;
+ HMAC_Update(&ctx, &divider, 1);
+ HMAC_Update(&ctx, (const unsigned char*)context, strlen(context));
+ unsigned int contextDisambiguation = strlen(context) * 8;
+ endianswap(&contextDisambiguation);
+ HMAC_Update(&ctx, (const unsigned char*)&contextDisambiguation, 4);
+ unsigned int finalValue = 256;
+ endianswap(&finalValue);
+ HMAC_Update(&ctx, (const unsigned char*)&finalValue, 4);
+
+ unsigned char output[SHA256_DIGEST_LENGTH];
+ unsigned int out_size = 0;
+ HMAC_Final(&ctx, output, &out_size);
+
+ int index = 0;
+ char hex_hash[SHA256_HEX_SIZE + 1];
+ for(index = 0; index < SHA256_DIGEST_LENGTH; index++)
+ sprintf(hex_hash + (index * 2), "%02x", output[index]);
+ hex_hash[SHA256_HEX_SIZE] = 0;
+ std::string ret = hex_hash;
+ return ret;
+}
+
std::string HashPassword(const std::string& Password) {
const char* prefix = FBE_PERSONALIZATION;
return PersonalizedHash(prefix, Password);
diff --git a/crypto/ext4crypt/HashPassword.h b/crypto/ext4crypt/HashPassword.h
index 4be107b51..73880b1ba 100644
--- a/crypto/ext4crypt/HashPassword.h
+++ b/crypto/ext4crypt/HashPassword.h
@@ -26,11 +26,19 @@
#define PERSONALIZATION_FBE_KEY "fbe-key"
#define PERSONALIZATION_USER_GK_AUTH "user-gk-authentication"
#define PERSONALISATION_SECDISCARDABLE "secdiscardable-transform"
+#define PERSONALISATION_CONTEXT "android-synthetic-password-personalization-context"
void* PersonalizedHashBinary(const char* prefix, const char* key, const size_t key_size);
std::string PersonalizedHash(const char* prefix, const char* key, const size_t key_size);
std::string PersonalizedHash(const char* prefix, const std::string& Password);
+std::string PersonalizedHashSP800(const char* label, const char* context, const char* key, const size_t key_size);
std::string HashPassword(const std::string& Password);
+template <class T>
+void endianswap(T *objp) {
+ unsigned char *memp = reinterpret_cast<unsigned char*>(objp);
+ std::reverse(memp, memp + sizeof(T));
+}
+
#endif
diff --git a/crypto/scrypt/Scrypt.mk b/crypto/scrypt/Scrypt.mk
index baa41eca6..67e73c80f 100644
--- a/crypto/scrypt/Scrypt.mk
+++ b/crypto/scrypt/Scrypt.mk
@@ -27,7 +27,11 @@ LOCAL_CFLAGS += $(target_c_flags)
LOCAL_C_INCLUDES += $(target_c_includes) $(commands_recovery_local_path)/crypto/scrypt/lib/util
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libscrypttwrp_static
-LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := $(local_additional_dependencies)
+else
+ LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies)
+endif
include $(BUILD_STATIC_LIBRARY)
########################################
@@ -42,5 +46,9 @@ LOCAL_C_INCLUDES += $(host_c_includes) $(commands_recovery_local_path)/crypto/sc
LOCAL_LDLIBS += -ldl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:= libscrypttwrp_static
-LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := $(local_additional_dependencies)
+else
+ LOCAL_ADDITIONAL_DEPENDENCIES := $(local_additional_dependencies)
+endif
include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/data.cpp b/data.cpp
index cd03d78ac..088dbda68 100755
--- a/data.cpp
+++ b/data.cpp
@@ -909,11 +909,13 @@ void DataManager::SetDefaultValues()
#ifdef TW_OEM_BUILD
LOGINFO("TW_OEM_BUILD := true\n");
mConst.SetValue("tw_oem_build", "1");
+ mConst.SetValue("tw_app_installed_in_system", "0");
#else
mConst.SetValue("tw_oem_build", "0");
mPersist.SetValue("tw_app_prompt", "1");
mPersist.SetValue("tw_app_install_system", "1");
mData.SetValue("tw_app_install_status", "0"); // 0 = no status, 1 = not installed, 2 = already installed
+ mData.SetValue("tw_app_installed_in_system", "0");
#endif
mData.SetValue("tw_enable_adb_backup", "0");
diff --git a/etc/init.recovery.logd.rc b/etc/init.recovery.logd.rc
index 7bdbfb8bc..423039cf0 100644
--- a/etc/init.recovery.logd.rc
+++ b/etc/init.recovery.logd.rc
@@ -1,20 +1,8 @@
on load_all_props_action
start logd
- start logd-reinit
on load_persist_props_action
start logd
- start logd-reinit
-
-on post-fs
- start logd
-
-on post-fs-data
- start logd
-
-on property:vold.decrypt=trigger_load_persist_props
- start logd
- start logd-reinit
service logd /sbin/logd
class core
@@ -23,8 +11,3 @@ service logd /sbin/logd
socket logdw dgram 0222 logd logd
group root system
seclabel u:r:logd:s0
-
-service logd-reinit /sbin/logd --reinit
- oneshot
- disabled
- seclabel u:r:logd:s0
diff --git a/fb2png/fb.c b/fb2png/fb.c
index 2ed478902..a17f801df 100644
--- a/fb2png/fb.c
+++ b/fb2png/fb.c
@@ -48,7 +48,6 @@ static int fb_get_format(const struct fb *fb)
{
int ao = fb->alpha_offset;
int ro = fb->red_offset;
- int go = fb->green_offset;
int bo = fb->blue_offset;
#define FB_FORMAT_UNKNOWN 0
diff --git a/fb2png/img_process.c b/fb2png/img_process.c
index eb75e9a21..535ec2287 100644
--- a/fb2png/img_process.c
+++ b/fb2png/img_process.c
@@ -32,7 +32,7 @@ int rgb565_to_rgb888(const char* src, char* dst, size_t pixel)
from = (struct rgb565 *) src;
to = (struct rgb888 *) dst;
- int i = 0;
+ size_t i = 0;
/* traverse pixel of the row */
while(i++ < pixel) {
@@ -53,7 +53,7 @@ int rgb565_to_rgb888(const char* src, char* dst, size_t pixel)
int argb8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
- int i;
+ size_t i;
struct argb8888 *from;
struct rgb888 *to;
@@ -77,7 +77,7 @@ int argb8888_to_rgb888(const char* src, char* dst, size_t pixel)
int abgr8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
- int i;
+ size_t i;
struct abgr8888 *from;
struct rgb888 *to;
@@ -101,7 +101,7 @@ int abgr8888_to_rgb888(const char* src, char* dst, size_t pixel)
int bgra8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
- int i;
+ size_t i;
struct bgra8888 *from;
struct rgb888 *to;
@@ -125,7 +125,7 @@ int bgra8888_to_rgb888(const char* src, char* dst, size_t pixel)
int rgba8888_to_rgb888(const char* src, char* dst, size_t pixel)
{
- int i;
+ size_t i;
struct rgba8888 *from;
struct rgb888 *to;
@@ -164,19 +164,19 @@ stdio_write_func (png_structp png, png_bytep data, png_size_t size)
}
static void
-png_simple_output_flush_fn (png_structp png_ptr)
+png_simple_output_flush_fn (__attribute__((unused)) png_structp png_ptr)
{
}
static void
-png_simple_error_callback (png_structp png,
+png_simple_error_callback (__attribute__((unused)) png_structp png,
png_const_charp error_msg)
{
E("png error: %s\n", error_msg);
}
static void
-png_simple_warning_callback (png_structp png,
+png_simple_warning_callback (__attribute__((unused)) png_structp png,
png_const_charp error_msg)
{
fprintf(stderr, "png warning: %s\n", error_msg);
diff --git a/fb2png/log.h b/fb2png/log.h
index 2b7cf8cec..a2e3f5f54 100644
--- a/fb2png/log.h
+++ b/fb2png/log.h
@@ -57,7 +57,7 @@
#endif
-static void
+__attribute__((unused)) static void
D(const char *msg, ...)
{
va_list ap;
@@ -69,7 +69,7 @@ D(const char *msg, ...)
fflush(stdout);
}
-static void
+__attribute__((unused)) static void
E(const char *msg, ...)
{
va_list ap;
diff --git a/gui/action.cpp b/gui/action.cpp
index c4e78cf26..ccb7e344e 100755
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -231,6 +231,7 @@ GUIAction::GUIAction(xml_node<>* node)
ADD_ACTION(twcmd);
ADD_ACTION(setbootslot);
ADD_ACTION(installapp);
+ ADD_ACTION(uninstalltwrpsystemapp);
ADD_ACTION(repackimage);
ADD_ACTION(fixabrecoverybootloop);
}
@@ -1919,19 +1920,9 @@ int GUIAction::checkforapp(std::string arg __unused)
DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed or do not install
goto exit;
}
- if (PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), false)) {
- string base_path = PartitionManager.Get_Android_Root_Path();
- if (TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system"))
- base_path += "/system"; // For devices with system as a root file system (e.g. Pixel)
- string install_path = base_path + "/priv-app";
- if (!TWFunc::Path_Exists(install_path))
- install_path = base_path + "/app";
- install_path += "/twrpapp";
- if (TWFunc::Path_Exists(install_path)) {
- LOGINFO("App found at '%s'\n", install_path.c_str());
- DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install
- goto exit;
- }
+ if (TWFunc::Is_TWRP_App_In_System()) {
+ DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install
+ goto exit;
}
if (PartitionManager.Mount_By_Path("/data", false)) {
const char parent_path[] = "/data/app";
@@ -2058,6 +2049,59 @@ exit:
return 0;
}
+int GUIAction::uninstalltwrpsystemapp(std::string arg __unused)
+{
+ int op_status = 1;
+ operation_start("Uninstall TWRP System App");
+ if (!simulate)
+ {
+ int Mount_System_RO = DataManager::GetIntValue("tw_mount_system_ro");
+ TWPartition* Part = PartitionManager.Find_Partition_By_Path(PartitionManager.Get_Android_Root_Path());
+ if (!Part) {
+ LOGERR("Unabled to find system partition.\n");
+ goto exit;
+ }
+ if (!Part->UnMount(true)) {
+ goto exit;
+ }
+ if (Mount_System_RO > 0) {
+ DataManager::SetValue("tw_mount_system_ro", 0);
+ Part->Change_Mount_Read_Only(false);
+ }
+ if (Part->Mount(true)) {
+ string base_path = PartitionManager.Get_Android_Root_Path();
+ if (TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system"))
+ base_path += "/system"; // For devices with system as a root file system (e.g. Pixel)
+ string uninstall_path = base_path + "/priv-app";
+ if (!TWFunc::Path_Exists(uninstall_path))
+ uninstall_path = base_path + "/app";
+ uninstall_path += "/twrpapp";
+ if (TWFunc::Path_Exists(uninstall_path)) {
+ LOGINFO("Uninstalling TWRP App from '%s'\n", uninstall_path.c_str());
+ if (TWFunc::removeDir(uninstall_path, false) == 0) {
+ sync();
+ op_status = 0;
+ DataManager::SetValue("tw_app_installed_in_system", 0);
+ DataManager::SetValue("tw_app_install_status", 0);
+ } else {
+ LOGERR("Unable to remove TWRP app from system.\n");
+ }
+ } else {
+ LOGINFO("didn't find TWRP app in '%s'\n", uninstall_path.c_str());
+ }
+ }
+ Part->UnMount(true);
+ if (Mount_System_RO > 0) {
+ DataManager::SetValue("tw_mount_system_ro", Mount_System_RO);
+ Part->Change_Mount_Read_Only(true);
+ }
+ } else
+ simulate_progress_bar();
+exit:
+ operation_end(0);
+ return 0;
+}
+
int GUIAction::repackimage(std::string arg __unused)
{
int op_status = 1;
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 2e306e0f7..3f7241831 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -367,6 +367,7 @@ protected:
int twcmd(std::string arg);
int setbootslot(std::string arg);
int installapp(std::string arg);
+ int uninstalltwrpsystemapp(std::string arg);
int repackimage(std::string arg);
int fixabrecoverybootloop(std::string arg);
diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml
index bb9878fd6..8244c461e 100755
--- a/gui/theme/common/landscape.xml
+++ b/gui/theme/common/landscape.xml
@@ -3433,6 +3433,18 @@
<action function="page">confirm_action</action>
</actions>
</listitem>
+ <listitem name="{@uninstall_twrp_system_app=Uninstall TWRP App from System}">
+ <condition var1="tw_app_installed_in_system" var2="1"/>
+ <actions>
+ <action function="set">tw_back=advanced</action>
+ <action function="set">tw_action=uninstalltwrpsystemapp</action>
+ <action function="set">tw_text1={@uninstall_twrp_system_app_confirm=Uninstall TWRP App from System?}</action>
+ <action function="set">tw_action_text1={@uninstalling_twrp_system_app=Uninstalling TWRP App from System...}</action>
+ <action function="set">tw_complete_text1={@uninstall_twrp_system_app_complete=Uninstall TWRP App from System Complete}</action>
+ <action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
+ <action function="page">confirm_action</action>
+ </actions>
+ </listitem>
</listbox>
<action>
diff --git a/gui/theme/common/languages/en.xml b/gui/theme/common/languages/en.xml
index 7a6012074..4a0ac7fdc 100755
--- a/gui/theme/common/languages/en.xml
+++ b/gui/theme/common/languages/en.xml
@@ -109,7 +109,6 @@
<string name="wipe_cache_dalvik_confirm">Wipe Cache &amp; Dalvik?</string>
<string name="wipe_dalvik_confirm">Wipe Dalvik?</string>
<string name="wiping_cache_dalvik">Wiping Cache &amp; Dalvik...</string>
- <string name="wiping_dalvik">Wiping Dalvik...</string>
<string name="wipe_cache_dalvik_complete">Cache &amp; Dalvik Wipe Complete</string>
<string name="wipe_dalvik_complete">Dalvik Wipe Complete</string>
<string name="swipe_wipe">Swipe to Wipe</string>
@@ -127,6 +126,10 @@
<string name="reboot_install_app_system">Install as a System App</string>
<string name="reboot_installing_app">Installing App...</string>
<string name="swipe_to_install_app">Swipe to Install TWRP App</string>
+ <string name="uninstall_twrp_system_app">Uninstall TWRP App from System</string>
+ <string name="uninstall_twrp_system_app_confirm">Uninstall TWRP App from System?</string>
+ <string name="uninstalling_twrp_system_app">Uninstalling TWRP App from System...</string>
+ <string name="uninstall_twrp_system_app_complete">Uninstall TWRP App from System Complete</string>
<string name="swipe_flash">Swipe to confirm Flash</string>
<string name="confirm_action">Confirm Action</string>
<string name="back_cancel">Press back button to cancel.</string>
diff --git a/gui/theme/common/languages/ru.xml b/gui/theme/common/languages/ru.xml
index 95fd3718a..284e45fab 100644
--- a/gui/theme/common/languages/ru.xml
+++ b/gui/theme/common/languages/ru.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<language>
<display>Русский</display>
- <!-- Translated by Jemmini; modified by agur4ik, SevenMaxs, S-trace 2017 -->
+ <!-- Translated by Jemmini; modified by agur4ik, SevenMaxs, S-trace 2017, f2065 -->
<resources>
<!-- Font overrides - only change these if your language requires special characters -->
@@ -9,6 +9,7 @@
<resource filename="RobotoCondensed-Regular.ttf" name="font_m" scale="90" type="fontoverride"/>
<resource filename="RobotoCondensed-Regular.ttf" name="font_s" scale="90" type="fontoverride"/>
<resource filename="DroidSansMono.ttf" name="fixed" scale="100" type="fontoverride"/>
+
<!-- Partition display names -->
<string name="system">System</string>
<string name="system_image">System Image</string>
@@ -29,6 +30,8 @@
<string name="sdext">SD-EXT</string>
<string name="adopted_data">Adopted Data</string>
<string name="adopted_storage">Adopted Storage</string>
+ <string name="autostorage">Storage</string>
+
<!-- GUI XML strings -->
<string name="twrp_header">Team Win Recovery Project</string>
<string name="twrp_watch_header">TWRP %tw_version%</string>
@@ -47,6 +50,7 @@
<string name="tab_screen">ЭКРАН</string>
<string name="tab_vibration">ВИБРАЦИЯ</string>
<string name="tab_language">ЯЗЫК</string>
+
<string name="install_btn">Установка</string>
<string name="wipe_btn">Очистка</string>
<string name="backup_btn">Резервное коп-ние</string>
@@ -86,7 +90,7 @@
<string name="zip_queue">Очередь:</string>
<string name="options">Опции:</string>
<string name="swipe_confirm"> Подтвердить</string>
- <string name="zip_add_btn">Добавить еще Zip</string>
+ <string name="zip_add_btn">Добавить ещё Zip</string>
<string name="zip_clear_btn">Очистить очередь Zip</string>
<string name="install_zip_count_hdr">Установка Zip %tw_zip_index% из %tw_zip_queue_count%</string>
<string name="installing_zip_xml">Установка Zip: %tw_file%</string>
@@ -95,6 +99,7 @@
<string name="install_failed">Установка не удалась</string>
<string name="install_successful">Установка выполнена успешно</string>
<string name="wipe_cache_dalvik_btn">Очистка cache/dalvik</string>
+ <string name="wipe_dalvik_btn">Очистка dalvik</string>
<string name="reboot_system_btn">Перезагрузка в ОС</string>
<string name="install_sel_target">Выбор раздела</string>
<string name="flash_image_select">Выберите раздел для прошивки образа:</string>
@@ -102,8 +107,11 @@
<string name="flashing_image">Прошивка образа...</string>
<string name="image_flashed">Прошивка образа завершена</string>
<string name="wipe_cache_dalvik_confirm">Очистить Cache &amp; Dalvik?</string>
+ <string name="wipe_dalvik_confirm">Очистить Dalvik?</string>
<string name="wiping_cache_dalvik">Очистка Cache &amp; Dalvik...</string>
+ <string name="wiping_dalvik">Очистка Dalvik...</string>
<string name="wipe_cache_dalvik_complete">Очистка Cache &amp; Dalvik завершена</string>
+ <string name="wipe_dalvik_complete">Очистка Dalvik завершена</string>
<string name="swipe_wipe">Свайп для очистки</string>
<string name="swipe_wipe_s"> Очистка</string>
<string name="no_os1">Система не установлена! Вы уверены,</string>
@@ -137,7 +145,7 @@
<string name="formatting_data">Форматирование Data...</string>
<string name="swipe_format_data">Свайп для форматирования</string>
<string name="swipe_format_data_s"> Форматировать Data</string>
- <string name="factory_reset_complete">Сброс до заводского состояния завершен</string>
+ <string name="factory_reset_complete">Сброс до заводского состояния завершён</string>
<string name="sel_part_hdr">Выбор разделов</string>
<string name="wipe_sel_confirm">Очистить выбранные разделы?</string>
<string name="wiping_part">Очистка разделов...</string>
@@ -166,8 +174,8 @@
<string name="part_curr_fs">Файловая система: %tw_partition_file_system%</string>
<string name="part_present_yes">Присутствует: да</string>
<string name="part_present_no">Присутствует: нет</string>
- <string name="part_removable_yes">Съемное: да</string>
- <string name="part_removable_no">Съемное: нет</string>
+ <string name="part_removable_yes">Съёмное: да</string>
+ <string name="part_removable_no">Съёмное: нет</string>
<string name="part_size">Размер: %tw_partition_size% МБ</string>
<string name="part_used">Использовано: %tw_partition_used% МБ</string>
<string name="part_free">Свободно: %tw_partition_free% МБ</string>
@@ -212,7 +220,7 @@
<string name="enc_disabled">выключено - установите пароль для включения</string>
<string name="enc_enabled">включено</string>
<string name="enable_backup_comp_chk">Использовать сжатие</string>
- <string name="skip_digest_backup_chk" version="2">Пропустить вычисление MD5</string>
+ <string name="skip_digest_backup_chk" version="2">Пропустить вычисление контрольных сумм</string>
<string name="disable_backup_space_chk" version="2">Отключить проверку свободного места</string>
<string name="current_boot_slot">Текущий слот: %tw_active_slot%</string>
<string name="boot_slot_a">Слот A</string>
@@ -225,7 +233,7 @@
<string name="backup_name_exists">Резервная копия с таким именем уже существует!</string>
<string name="encrypt_backup">Зашифровать вашу резервную копию?</string>
<string name="enter_pass">Введите пароль:</string>
- <string name="enter_pass2">Введите пароль еще раз:</string>
+ <string name="enter_pass2">Введите пароль ещё раз:</string>
<string name="pass_not_match">Пароли не совпадают!</string>
<string name="partitions">Разделы:</string>
<string name="disabled">Выключено</string>
@@ -250,7 +258,7 @@
<string name="restore_try_decrypt_s">Попытка расшифровки</string>
<string name="restore_backup_date">Резервная копия создана: %tw_restore_file_date%</string>
<string name="restore_sel_part">Выбор раздела для восстановления:</string>
- <string name="restore_enable_digest_chk" version="2">Включить проверку Digest файлов резервной копии</string>
+ <string name="restore_enable_digest_chk" version="2">Включить проверку контрольных сумм резервной копии</string>
<string name="restore_complete">Восстановление завершено</string>
<string name="swipe_restore">Свайп для восстановления</string>
<string name="swipe_restore_s"> Восстановление</string>
@@ -271,7 +279,7 @@
<string name="enable_mtp_btn">Включить MTP</string>
<string name="mount_usb_storage_btn">Включить UMS</string>
<string name="usb_storage_hdr">USB накопитель</string>
- <string name="usb_stor_mnt1">Режим USB накопителя включен</string>
+ <string name="usb_stor_mnt1">Режим USB накопителя включён</string>
<string name="usb_stor_mnt2">Перед отключением вашего устройства от компьютера,</string>
<string name="usb_stor_mnt3">выполните размонтирование (выключите UMS)!</string>
<string name="unmount_btn">Выключить UMS</string>
@@ -290,11 +298,11 @@
<string name="sys_rop2">чтобы сохранить возможность официальных обновлений.</string>
<string name="sys_rop3">При этом система сможет вернуть обратно стоковый</string>
<string name="sys_rop4">рекавери, а TWRP не будет предлагать установку root.</string>
- <string name="sys_rop5">Установка zip или работа adb все равно смогут изменять</string>
+ <string name="sys_rop5">Установка zip или работа adb всё равно смогут изменять</string>
<string name="sys_rop6">системный раздел.</string>
- <string name="sys_rol1">TWRP может оставить системный раздел неизменным, чтобы сохранить возможность официальних обновлений.</string>
+ <string name="sys_rol1">TWRP может оставить системный раздел неизменным, чтобы сохранить возможность официальных обновлений.</string>
<string name="sys_rol2">При этом система сможет вернуть обратно стоковый рекавери, а TWRP не будет предлагать установку root.</string>
- <string name="sys_rol3">Установка zip или работа adb все равно смогут изменять системный раздел.</string>
+ <string name="sys_rol3">Установка zip или работа adb всё равно смогут изменять системный раздел.</string>
<string name="sys_ro_never_show_chk">Больше не показывать это при загрузке</string>
<string name="sys_ro_keep_ro_btn">Только для чтения</string>
<string name="swipe_allow_mod">Разрешить изменения</string>
@@ -315,36 +323,37 @@
<string name="settings_tz_btn">Часовой пояс</string>
<string name="settings_screen_btn">Экран</string>
<string name="settings_screen_bright_btn">Яркость</string>
+ <string name="vibration_disabled">Вибрация отключена для этого устройства</string>
<string name="settings_vibration_btn">Вибрация</string>
<string name="settings_language_btn">Язык</string>
<string name="time_zone_hdr">Часовой пояс</string>
<string name="sel_tz_list">Выбор часового пояса:</string>
<!-- Translator note: if it does not make sense to translate the locations or if it makes more sense,
feel free to change the location listed or drop the location entirely and just call it UTC -6 -->
- <string name="utcm11">(UTC -11) о. Мидуэй, Самоа</string>
- <string name="utcm10">(UTC -10) Гавайи</string>
- <string name="utcm9">(UTC -9) Аляска</string>
- <string name="utcm8">(UTC -8) Тихоокеанский часовой пояс</string>
- <string name="utcm7">(UTC -7) Горное время (США и Канада), Аризона</string>
- <string name="utcm6">(UTC -6) Центральное время (США и Канада), Центральная Америка</string>
- <string name="utcm5">(UTC -5) Восточное время (США и Канада), Индиана (восток)</string>
- <string name="utcm4">(UTC -4) Атлантическое время (Канада), Каракас</string>
- <string name="utcm3">(UTC -3) Бразилия, Буэнос-Айрес</string>
- <string name="utcm2">(UTC -2) Среднеатлантическое время</string>
- <string name="utcm1">(UTC -1) Азорские о-ва, о-ва Зелёного мыса</string>
- <string name="utc0">(UTC 0) Лондон, Дублин, Лиссабон</string>
- <string name="utcp1">(UTC +1) Берлин, Брюссель, Париж</string>
- <string name="utcp2">(UTC +2) Киев, Минск, Рига, Таллин, Стамбул</string>
- <string name="utcp3">(UTC +3) Москва, Санкт-Петербург, Волгоград, Багдад</string>
- <string name="utcp4">(UTC +4) Баку, Ереван, Тбилиси, Абу-Даби, Мускат</string>
- <string name="utcp5">(UTC +5) Ташкент, Исламабад, Карачи</string>
- <string name="utcp6">(UTC +6) Алматы, Астана, Дхака, Екатеринбург</string>
- <string name="utcp7">(UTC +7) Омск, Новосибирск, Бангкок, Джакарта, Ханой</string>
- <string name="utcp8">(UTC +8) Красноярск, Пекин, Улан-Батор, Иркутск</string>
- <string name="utcp9">(UTC +9) Осака, Саппоро, Токио, Сеул, Якутск</string>
- <string name="utcp10">(UTC +10) Гуам, Канберра, Мельбурн, Сидней</string>
- <string name="utcp11">(UTC +11) Владивосток, Сахалин, Соломоновы о-ва</string>
- <string name="utcp12">(UTC +12) Магадан, Камчатка, Фиджи, Маршаловы о-ва</string>
+ <string name="utcm11">(UTC-11, SST) о.Мидуэй, Самоа</string>
+ <string name="utcm10">(UTC-10, HAST) Гавайи</string>
+ <string name="utcm9">(UTC-9, AKST) Аляска</string>
+ <string name="utcm8">(UTC-8, PST) Тихоокеанское время (США и Канада), Тихуана</string>
+ <string name="utcm7">(UTC-7, MST) Горное время (США и Канада), Аризона</string>
+ <string name="utcm6">(UTC-6, CST) Центральное время (США и Канада), Мехико</string>
+ <string name="utcm5">(UTC-5, EST) Восточное время (США и Канада), Богота, Лима, Кито</string>
+ <string name="utcm4">(UTC-4, AST) Атлантическое время (Канада), Каракас, Ла Пас, Сантьяго</string>
+ <string name="utcm3">(UTC-3) Бразилия, Буэнос-Айрес, Джорджтаун, Гренландия</string>
+ <string name="utcm2">(UTC-2) Среднеатлантическое время</string>
+ <string name="utcm1">(UTC-1) Азорские о-ва, Кабо-Верде (о-ва Зелёного мыса)</string>
+ <string name="utc0">(UTC 0) Лондон, Касабланка, Дублин, Лиссабон</string>
+ <string name="utcp1">(UTC+1, CET) Амстердам, Берлин, Брюссель, Мадрид, Париж, Рим</string>
+ <string name="utcp2">(UTC+2, KALT, EET) Калининград, Киев, Хельсинки, Варшава</string>
+ <string name="utcp3">(UTC+3, MSK) Московское время, Москва, Минск, Эр-Рияд</string>
+ <string name="utcp4">(UTC+4, SAMT) Самарское время, Волгоград, Баку, Тбилиси</string>
+ <string name="utcp5">(UTC+5, YEKT) Екатеринбургское время, Уфа, Челябинск, Ташкент</string>
+ <string name="utcp6">(UTC+6, OMST) Омское время, Алма-Ата, Бишкек</string>
+ <string name="utcp7">(UTC+7, KRAT) Красноярское время, Новосибирск, Томск</string>
+ <string name="utcp8">(UTC+8, IRKT) Иркутское время, Пекин, Гонконг, Сингапур</string>
+ <string name="utcp9">(UTC+9, YAKT) Якутское время, Чита, Токио, Сеул</string>
+ <string name="utcp10">(UTC+10, VLAT) Владивостокское время, Хабаровск, Сидней</string>
+ <string name="utcp11">(UTC+11, MAGT) Магаданское время, Южно-Сахалинск</string>
+ <string name="utcp12">(UTC+12, PETT, WAKT) Камчатское время, Анадырь</string>
<string name="sel_tz_offset">Выбор смещения (как правило 0): %tw_time_zone_guioffset%</string>
<string name="tz_offset_none">Нет</string>
<string name="tz_offset_0">0</string>
@@ -391,8 +400,8 @@
<string name="inject_twrp_complete">Интегрирование TWRP завершено</string>
<string name="swipe_to_confirm">Свайп для подтверждения</string>
<string name="part_sd_hdr">Разметка SD-карты</string>
- <string name="invalid_partsd_sel">Вы должны выбрать съемное устройство</string>
- <string name="part_sd_lose">Все файлы на вашей SD-карте будут стерты!</string>
+ <string name="invalid_partsd_sel">Вы должны выбрать съёмное устройство</string>
+ <string name="part_sd_lose">Все файлы на вашей SD-карте будут стёрты!</string>
<string name="part_sd_undo">Это действие не может быть отменено!</string>
<string name="part_sd_ext_sz">Размер EXT-раздела:</string>
<string name="part_sd_swap_sz">Размер swap-раздела:</string>
@@ -452,6 +461,7 @@
<string name="decrypt_data_failed_pattern">Шаблон неверный, попробуйте снова!</string>
<string name="decrypt_data_enter_pattern">Введите шаблон.</string>
<string name="decrypt_data_trying">Попытка расшифровки</string>
+ <string name="decrypt_data_vold_os_missing">Missing files needed for vold decrypt: {1}</string>
<string name="term_hdr">Команда терминала</string>
<string name="term_s_hdr">Терминал</string>
<string name="term_kill_btn">УБИТЬ</string>
@@ -463,7 +473,7 @@
<string name="swipe_sideload"> Старт</string>
<string name="sideload_confirm">ADB Sideload</string>
<string name="sideload_usage">Пример: adb sideload filename.zip</string>
- <string name="sideload_complete">ADB Sideload завершен</string>
+ <string name="sideload_complete">ADB Sideload завершён</string>
<string name="fix_contexts_hdr">Исправление контекста SELinux</string>
<string name="fix_contexts_note1">Примечание: исправление контекста SELinux требуется редко.</string>
<string name="fix_contexts_note2">Исправление SELinux-контекста может привести</string>
@@ -476,6 +486,29 @@
<string name="install_cancel">Не устанавливать</string>
<string name="sel_storage_list">Выберите накопитель</string>
<string name="ok_btn">OK</string>
+ <string name="install_twrp_ramdisk">Установка рекавери в ramdisk</string>
+ <string name="install_kernel">Установка ядра</string>
+ <string name="repack_kernel_confirm_hdr">Установка ярда</string>
+ <string name="repack_ramdisk_confirm_hdr">Установка рекавери</string>
+ <string name="repack_kernel_confirm">Установить ядро?</string>
+ <string name="repack_ramdisk_confirm">Установить рекавери?</string>
+ <string name="repack_backup_first">Сначала сделайте резервную копию текущего образа</string>
+ <string name="repack">Перепаковка</string>
+ <string name="swipe_to_install">Свайп для установки</string>
+ <string name="installing">Установка...</string>
+ <string name="install_complete">Установка завершена</string>
+ <string name="unpack_error">Ошибка распаковки образа.</string>
+ <string name="repack_error">Ошибка перепаковки образа.</string>
+ <string name="unpacking_image">Распаковка {1}...</string>
+ <string name="repacking_image">Перепаковка {1}...</string>
+ <string name="repack_image_hdr">Выбор образа</string>
+ <string name="fix_recovery_loop">Исправить циклическую перезагрузку рекавери</string>
+ <string name="fix_recovery_loop_confirm">Исправить циклическую перезагрузку рекавери?</string>
+ <string name="fixing_recovery_loop">Исправление циклической перезагрузки рекавери...</string>
+ <string name="fix_recovery_loop_complete">Исправление циклической перезагрузки рекавери завершено</string>
+ <string name="fixing_recovery_loop_patch">Патчинг ядра...</string>
+ <string name="fix_recovery_loop_patch_error">Ошибка патчинга ядра.</string>
+
<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
<string name="no_kernel_selinux">Чтение SELinux-контекста не поддерживается ядром.</string>
<string name="full_selinux">Присутствует полная поддержка SELinux.</string>
@@ -484,24 +517,24 @@
<string name="mtp_crash">Сбой MTP: MTP не запущен при загрузке.</string>
<string name="decrypt_success">Расшифровка выполнена успешно с паролем по умолчанию.</string>
<string name="unable_to_decrypt">Невозможно расшифровать с паролем по умолчанию. Возможно потребуется выполнить форматирование Data.</string>
- <string name="generating_digest1" version="2">Вычисление Digest</string>
+ <string name="generating_digest1" version="2">Вычисление контрольной суммы</string>
<!-- Message displayed during a backup if we are generating an Digest, ideally, leave the leading " * " to help align and separate this text from other console text -->
- <string name="generating_digest2" version="2"> * Вычисление Digest...</string>
- <string name="digest_created" version="2"> * Digest создана.</string>
- <string name="digest_error" version="2"> * Ошибка Digest!</string>
- <string name="digest_compute_error" version="2"> * Ошибка вычисления Digest.</string>
+ <string name="generating_digest2" version="2"> * Вычисление контрольной суммы...</string>
+ <string name="digest_created" version="2"> * Контрольная сумма создана.</string>
+ <string name="digest_error" version="2"> * Ошибка контрольной суммы!</string>
+ <string name="digest_compute_error" version="2"> * Ошибка вычисления контрольной суммы.</string>
<string name="current_date">(Текущая дата)</string>
<string name="auto_generate">(Создать автоматически)</string>
- <string name="unable_to_locate_partition">Не удается найти '{1}' раздел для расчета копирования.</string>
+ <string name="unable_to_locate_partition">Не удаётся найти '{1}' раздел для расчёта копирования.</string>
<string name="no_partition_selected">Не выбраны разделы для резервного копирования.</string>
<string name="total_partitions_backup"> * Общее количество разделов для резервного копирования: {1}</string>
- <string name="total_backup_size"> * Общий объем данных: {1} МБ</string>
- <string name="available_space"> * Доступный объем: {1} МБ</string>
- <string name="unable_locate_storage">Не удается найти накопитель для хранения.</string>
+ <string name="total_backup_size"> * Общий объём данных: {1} МБ</string>
+ <string name="available_space"> * Доступный объём: {1} МБ</string>
+ <string name="unable_locate_storage">Не удаётся найти накопитель для хранения.</string>
<string name="no_space">В накопителе для хранения недостаточно свободного места.</string>
<string name="backup_started">[РЕЗЕРВНОЕ КОПИРОВАНИЕ НАЧАТО]</string>
<string name="backup_folder"> * Папка для резервной копии: {1}</string>
- <string name="fail_backup_folder">Не удается создать папку для резервной копии.</string>
+ <string name="fail_backup_folder">Не удаётся создать папку для резервной копии.</string>
<string name="avg_backup_fs">Средняя скорость копирования для файлов: {1} МБ/сек</string>
<string name="avg_backup_img">Средняя скорость копирования для образов: {1} МБ/сек</string>
<string name="total_backed_size">[ВСЕГО СКОПИРОВАНО {1} МБ]</string>
@@ -510,11 +543,11 @@
<string name="restore_folder">Папка для восстановления: '{1}'</string>
<!-- {1} is the partition display name and {2} is the number of seconds -->
<string name="restore_part_done">[{1} выполнено за {2} секунд(ы)]</string>
- <string name="verifying_digest" version="2">Проверка Digest</string>
- <string name="skip_digest" version="2">Пропуск проверки Digest согласно настройкам.</string>
+ <string name="verifying_digest" version="2">Проверка контрольной суммы</string>
+ <string name="skip_digest" version="2">Пропуск проверки контрольной суммы согласно настройкам.</string>
<string name="calc_restore">Вычисление информации о восстановлении...</string>
<string name="restore_read_only">Невозможно восстановить {1} -- смонтировано только для чтения.</string>
- <string name="restore_unable_locate">Не удается найти '{1}' раздел для восстановления.</string>
+ <string name="restore_unable_locate">Не удаётся найти '{1}' раздел для восстановления.</string>
<string name="no_part_restore">Не выбраны разделы для восстановления.</string>
<string name="restore_part_count">Восстановление {1} разделов...</string>
<string name="total_restore_size">Общий размер для восстановления: {1} МБ</string>
@@ -522,20 +555,21 @@
<string name="restore_completed">[ВОССТАНОВЛЕНИЕ ЗАВЕРШЕНО ЗА {1} СЕКУНД(Ы)]</string>
<!-- {1} is the path we could not open, {2} is strerror output -->
<string name="error_opening_strerr">Ошибка открытия: '{1}' ({2})</string>
- <string name="unable_locate_part_backup_name">Не удается найти раздел для копирования: '{1}'</string>
- <string name="unable_find_part_path">Не удается найти раздел по пути '{1}'</string>
+ <string name="unable_locate_part_backup_name">Не удаётся найти раздел для копирования: '{1}'</string>
+ <string name="unable_find_part_path">Не удаётся найти раздел по пути '{1}'</string>
<string name="update_part_details">Обновление информации о разделах...</string>
<string name="update_part_details_done">...готово</string>
- <string name="wiping_dalvik">Очистка директорий Dalvik Cache...</string>
+
<string name="cleaned">Очищены: {1}...</string>
- <string name="dalvik_done">-- Очистка директорий Dalvik Cache завершена!</string>
+ <string name="cache_dalvik_done">-- Очистка директорий Dalvik Cache завершена!</string>
+ <string name="dalvik_done">-- Очистка директорий Dalvik завершена!</string>
<string name="no_andsec">Не найдены разделы android secure.</string>
<string name="unable_to_locate">{1} не найден.</string>
<string name="wiping_datamedia">Очистка внутренней памяти -- /data/media...</string>
- <string name="unable_to_mount">Не удается смонтировать {1}</string>
- <string name="unable_to_mount_internal">Не удается смонтировать internal_storage</string>
- <string name="unable_to_mount_storage">Не удается смонтировать накопитель</string>
- <string name="fail_decrypt">Не удается расшифровать data.</string>
+ <string name="unable_to_mount">Не удаётся смонтировать {1}</string>
+ <string name="unable_to_mount_internal">Не удаётся смонтировать internal_storage</string>
+ <string name="unable_to_mount_storage">Не удаётся смонтировать накопитель</string>
+ <string name="fail_decrypt">Не удаётся расшифровать data.</string>
<string name="no_crypto_support">Шифрование не добавлено в эту сборку, пинайте разработчика.</string>
<string name="decrypt_success_dev">Раздел Data успешно расшифрован, новое блочное устройство: '{1}'</string>
<string name="decrypt_success_nodev">Раздел Data успешно расшифрован</string>
@@ -544,18 +578,18 @@
<string name="partition_sd_locate">Не удалось найти устройство для разметки.</string>
<string name="ext_swap_size">Размер EXT + Swap превышает размер sdcard.</string>
<string name="remove_part_table">Удаление таблицы разделов...</string>
- <string name="unable_rm_part">Не удается удалить таблицу разделов.</string>
+ <string name="unable_rm_part">Не удаётся удалить таблицу разделов.</string>
<string name="create_part">Создание раздела {1}...</string>
- <string name="unable_to_create_part">Не удается создать раздел {1}.</string>
+ <string name="unable_to_create_part">Не удаётся создать раздел {1}.</string>
<string name="format_sdext_as">Форматирование sd-ext в {1}...</string>
<string name="part_complete">Разметка завершена.</string>
- <string name="unable_to_open">Не удается открыть '{1}'.</string>
- <string name="mtp_already_enabled">MTP уже включен</string>
+ <string name="unable_to_open">Не удаётся открыть '{1}'.</string>
+ <string name="mtp_already_enabled">MTP уже включён</string>
<string name="mtp_fail">Не удалось включить MTP</string>
<string name="no_mtp">Поддержка MTP отсутствует</string>
<string name="image_flash_start">[ПРОШИВКА ОБРАЗА НАЧАТА]</string>
<string name="img_to_flash">Образ для прошивки: '{1}'</string>
- <string name="flash_unable_locate">Не удается найти раздел '{1}'.</string>
+ <string name="flash_unable_locate">Не удаётся найти раздел '{1}'.</string>
<string name="no_part_flash">Не выбраны разделы для прошивки.</string>
<string name="too_many_flash">Выбрано слишком много разделов для прошивки.</string>
<string name="invalid_flash">Указан неверный раздел для прошивки.</string>
@@ -568,17 +602,17 @@
<!-- {1} is the folder name that we could not create, {2} is strerror output -->
<string name="create_folder_strerr">Невозможно создать папку '{1}' ({2}).</string>
<!-- {1} is the folder name that we could not mount, {2} is strerror output -->
- <string name="fail_mount">Не удается смонтировать '{1}' ({2})</string>
+ <string name="fail_mount">Не удаётся смонтировать '{1}' ({2})</string>
<!-- {1} is the folder name that we could not unmount, {2} is strerror output -->
- <string name="fail_unmount">Не удается размонтировать '{1}' ({2})</string>
+ <string name="fail_unmount">Не удаётся размонтировать '{1}' ({2})</string>
<string name="cannot_resize">Невозможно изменить размер {1}.</string>
<string name="repair_resize">Восстановление {1} перед изменением размера.</string>
- <string name="unable_resize">Не удается изменить размер {1}.</string>
- <string name="no_digest_found" version="2">Отсутствует файл digest для '{1}'. Пожалуйста отмените выбор проверки Digest при восстановлении.</string>
- <string name="digest_fail_match" version="2">Digest не соответствует '{1}'.</string>
- <string name="digest_matched" version="2">Digest соответствует '{1}'.</string>
- <string name="fail_decrypt_tar">Не удается расшифровать tar-файл '{1}'</string>
- <string name="format_data_msg">Вам, возможно, потребуется перезагрузись рекавери, чтобы иметь возможность использовать /data снова.</string>
+ <string name="unable_resize">Не удаётся изменить размер {1}.</string>
+ <string name="no_digest_found" version="2">Отсутствует файл контрольной суммы для '{1}'. Пожалуйста отмените выбор проверки контрольных сумм при восстановлении.</string>
+ <string name="digest_fail_match" version="2">Контрольная сумма не соответствует '{1}'.</string>
+ <string name="digest_matched" version="2">Контрольная сумма соответствует '{1}'.</string>
+ <string name="fail_decrypt_tar">Не удаётся расшифровать tar-файл '{1}'</string>
+ <string name="format_data_msg">Вам, возможно, потребуется перезагрузить рекавери, чтобы иметь возможность использовать /data снова.</string>
<string name="format_data_err">Невозможно отформатировать и удалить шифрование.</string>
<string name="formatting_using">Форматирование {1} с помощью {2}...</string>
<string name="unable_to_wipe">Невозможно очистить {1}.</string>
@@ -596,10 +630,10 @@
<string name="img_size_err">Размер образа больше размера целевого устройства</string>
<string name="flashing">Прошивка {1}...</string>
<string name="backup_folder_set">Папка для резервной копии установлена в '{1}'</string>
- <string name="locate_backup_err">Не удается найти резервную копию '{1}'</string>
+ <string name="locate_backup_err">Не удаётся найти резервную копию '{1}'</string>
<string name="set_restore_opt">Установки опций восстановления: '{1}':</string>
- <string name="digest_check_skip" version="2">Пропуск проверки Digest включен</string>
- <string name="ors_encrypt_restore_err">Не удается использовать OpenRecoveryScript для восстановления зашифрованной резервной копии.</string>
+ <string name="digest_check_skip" version="2">Пропуск проверки контрольных сумм включён</string>
+ <string name="ors_encrypt_restore_err">Не удаётся использовать OpenRecoveryScript для восстановления зашифрованной резервной копии.</string>
<string name="mounting">Монтирование</string>
<string name="unmounting">Размонтирование</string>
<string name="mounted">'{1}' смонтирован</string>
@@ -619,23 +653,23 @@
<string name="installing_zip">Установка zip файла '{1}'</string>
<string name="select_backup_opt">Установка опций резервного копирования:</string>
<string name="compression_on">Сжатие включено</string>
- <string name="digest_off" version="2">Вычисление Digest выключено</string>
+ <string name="digest_off" version="2">Вычисление контрольных сумм выключено</string>
<string name="backup_fail">Ошибка резервного копирования</string>
<string name="backup_clean">Ошибка резервного копирования. Очистка папки с резервной копией.</string>
<string name="running_recovery_commands">Выполнение команд рекавери</string>
<string name="recovery_commands_complete">Команды рекавери завершены</string>
<string name="running_ors">Выполнение OpenRecoveryScript</string>
<string name="ors_complete">OpenRecoveryScript выполнен</string>
+ <string name="check_for_digest" version="2">Проверка файлов контрольных сумм...</string>
<string name="invalid_zip_format">Неверный формат zip файла!</string>
- <string name="check_for_digest" version="2">Проверка Digest-файлов...</string>
<string name="fail_sysmap">Не удалось отобразить в память файл '{1}'</string>
<string name="verify_zip_sig">Проверка подписи zip...</string>
<string name="verify_zip_fail">Подпись Zip не прошла проверку!</string>
<string name="verify_zip_done">Подпись Zip проверена успешно.</string>
- <string name="zip_corrupt">Zip-файл поврежден!</string>
- <string name="no_digest" version="2">Пропуск проверки Digest: не найден Digest-файл</string>
- <string name="digest_fail" version="2">Digest не соответствует</string>
- <string name="digest_match" version="2">Digest соответствует</string>
+ <string name="zip_corrupt">Zip-файл повреждён!</string>
+ <string name="no_digest" version="2">Пропуск проверки контрольной суммы: не найден файл контрольной суммы</string>
+ <string name="digest_fail" version="2">Контрольная сумма не соответствует</string>
+ <string name="digest_match" version="2">Контрольная сумма соответствует</string>
<string name="pid_signal">Процесс {1} завершился с кодом {2}</string>
<string name="pid_error">Процесс {1} завершился с ОШИБКОЙ: {2}</string>
<string name="install_dumlock">Установка HTC Dumlock в систему...</string>
@@ -659,7 +693,7 @@
<string name="copy_log">recovery.log скопирован в {1}.</string>
<string name="max_queue">Максимум zip в очереди достигнут!</string>
<string name="min_queue">Минимум zip в очереди достигнут!</string>
- <string name="screenshot_saved">Скриншот сохранен в {1}</string>
+ <string name="screenshot_saved">Скриншот сохранён в {1}</string>
<string name="screenshot_err">Не удалось сделать скриншот!</string>
<string name="zip_wipe_cache">Один или более zip запрашивают очистку cache -- Очистка cache...</string>
<string name="and_sec_wipe_err">Невозможно очистить android secure</string>
@@ -677,9 +711,10 @@
<string name="adbbackup_error">Ошибка резервного копирования по ADB. Выход...</string>
<string name="adbbackup_control_error">Невозможно записать в канал управления ADB.</string>
<string name="twrp_adbbu_option">-- эта опция позволяет делать резервное копирование по adb</string>
- <string name="partition_not_found">путь: {1} отсутсвует в списке разделов.</string>
+ <string name="partition_not_found">путь: {1} отсутствует в списке разделов.</string>
<string name="copy_kernel_log">Kernel Log скопирован в {1}</string>
<string name="include_kernel_log">Добавить Kernel Log</string>
+ <string name="sha2_chk">Использовать SHA2 для контрольных сумм (иначе - MD5)</string>
<string name="unable_set_boot_slot">Ошибка смены слота загрузки bootloader на {1}</string>
</resources>
</language>
diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml
index 691f149e0..e014cc53a 100755
--- a/gui/theme/common/portrait.xml
+++ b/gui/theme/common/portrait.xml
@@ -1751,7 +1751,7 @@
<text style="text_m">
<condition var1="tw_has_boot_slots" var2="1"/>
- <placement x="%center_x%" y="%row17_y%" placement="5"/>
+ <placement x="%center_x%" y="%row18_y%" placement="5"/>
<text>{@current_boot_slot=Current Slot: %tw_active_slot%}</text>
</text>
@@ -2893,7 +2893,7 @@
<text style="text_m">
<condition var1="tw_has_boot_slots" var2="1"/>
- <placement x="%center_x%" y="%row17_y%" placement="5"/>
+ <placement x="%center_x%" y="%row18_y%" placement="5"/>
<text>{@current_boot_slot=Current Slot: %tw_active_slot%}</text>
</text>
@@ -3594,6 +3594,18 @@
<action function="page">confirm_action</action>
</actions>
</listitem>
+ <listitem name="{@uninstall_twrp_system_app=Uninstall TWRP App from System}">
+ <condition var1="tw_app_installed_in_system" var2="1"/>
+ <actions>
+ <action function="set">tw_back=advanced</action>
+ <action function="set">tw_action=uninstalltwrpsystemapp</action>
+ <action function="set">tw_text1={@uninstall_twrp_system_app_confirm=Uninstall TWRP App from System?}</action>
+ <action function="set">tw_action_text1={@uninstalling_twrp_system_app=Uninstalling TWRP App from System...}</action>
+ <action function="set">tw_complete_text1={@uninstall_twrp_system_app_complete=Uninstall TWRP App from System Complete}</action>
+ <action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
+ <action function="page">confirm_action</action>
+ </actions>
+ </listitem>
</listbox>
<action>
diff --git a/gui/theme/common/watch.xml b/gui/theme/common/watch.xml
index fcb00bccf..f5d32228d 100755
--- a/gui/theme/common/watch.xml
+++ b/gui/theme/common/watch.xml
@@ -4205,6 +4205,18 @@
<action function="page">confirm_action</action>
</actions>
</listitem>
+ <listitem name="{@uninstall_twrp_system_app=Uninstall TWRP App from System}">
+ <condition var1="tw_app_installed_in_system" var2="1"/>
+ <actions>
+ <action function="set">tw_back=advanced</action>
+ <action function="set">tw_action=uninstalltwrpsystemapp</action>
+ <action function="set">tw_text1={@uninstall_twrp_system_app_confirm=Uninstall TWRP App from System?}</action>
+ <action function="set">tw_action_text1={@uninstalling_twrp_system_app=Uninstalling TWRP App from System...}</action>
+ <action function="set">tw_complete_text1={@uninstall_twrp_system_app_complete=Uninstall TWRP App from System Complete}</action>
+ <action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
+ <action function="page">confirm_action</action>
+ </actions>
+ </listitem>
</listbox>
<button>
diff --git a/gui/theme/extra-languages/languages/zh_CN.xml b/gui/theme/extra-languages/languages/zh_CN.xml
index 944be48b2..6b0c022e7 100644
--- a/gui/theme/extra-languages/languages/zh_CN.xml
+++ b/gui/theme/extra-languages/languages/zh_CN.xml
@@ -30,6 +30,7 @@
<string name="sdext">SD-EXT</string>
<string name="adopted_data">Adopted Data</string>
<string name="adopted_storage">Adopted 存储</string>
+ <string name="autostorage">存储</string>
<!-- GUI XML strings -->
<string name="twrp_header">Team Win Recovery Project</string>
@@ -98,6 +99,7 @@
<string name="install_failed">安装失败</string>
<string name="install_successful">安装成功</string>
<string name="wipe_cache_dalvik_btn">清除 Cache/Dalvik</string>
+ <string name="wipe_dalvik_btn">清除 Dalvik</string>
<string name="reboot_system_btn">重启系统</string>
<string name="install_sel_target">选择目标分区</string>
<string name="flash_image_select">选择要刷入镜像的分区:</string>
@@ -105,8 +107,10 @@
<string name="flashing_image">正在刷入镜像…</string>
<string name="image_flashed">镜像已刷入。</string>
<string name="wipe_cache_dalvik_confirm">是否清除 Cache 和 Dalvik?</string>
+ <string name="wipe_dalvik_confirm">是否清除 Dalvik?</string>
<string name="wiping_cache_dalvik">正在清除 Cache 和 Dalvik…</string>
<string name="wipe_cache_dalvik_complete">Cache 和 Dalvik 清除完成</string>
+ <string name="wipe_dalvik_complete">Dalvik 清除完成</string>
<string name="swipe_wipe">滑动按钮确认清除</string>
<string name="swipe_wipe_s"> 清除</string>
<string name="no_os1">没有安装任何系统!</string>
@@ -318,6 +322,7 @@
<string name="settings_tz_btn">时区</string>
<string name="settings_screen_btn">屏幕</string>
<string name="settings_screen_bright_btn">屏幕亮度</string>
+ <string name="vibration_disabled">振动已在本设备上停用</string>
<string name="settings_vibration_btn">振动</string>
<string name="settings_language_btn">语言</string>
<string name="time_zone_hdr">时区</string>
@@ -480,6 +485,28 @@
<string name="install_cancel">不,以后再说</string>
<string name="sel_storage_list">选择存储位置</string>
<string name="ok_btn">确定</string>
+ <string name="install_twrp_ramdisk">安装 Recovery Ramdisk</string>
+ <string name="install_kernel">安装内核</string>
+ <string name="repack_kernel_confirm_hdr">安装内核</string>
+ <string name="repack_ramdisk_confirm_hdr">安装 Recovery</string>
+ <string name="repack_kernel_confirm">是否安装内核?</string>
+ <string name="repack_ramdisk_confirm">是否安装 Recovery?</string>
+ <string name="repack_backup_first">请先备份现有的镜像</string>
+ <string name="repack">重新打包</string>
+ <string name="swipe_to_install">滑动按钮确认安装</string>
+ <string name="installing">正在安装…</string>
+ <string name="install_complete">安装完成</string>
+ <string name="unpack_error">解包镜像错误。</string>
+ <string name="repack_error">重新打包镜像错误。</string>
+ <string name="unpacking_image">正在解包 {1}…</string>
+ <string name="repacking_image">正在打包 {1}…</string>
+ <string name="repack_image_hdr">选择镜像</string>
+ <string name="fix_recovery_loop">修复 Recovery 无限重启</string>
+ <string name="fix_recovery_loop_confirm">是否修复 Recovery 无限重启?</string>
+ <string name="fixing_recovery_loop">正在修复 Recovery 无限重启…</string>
+ <string name="fix_recovery_loop_complete">Recovery 无限重启修复完成</string>
+ <string name="fixing_recovery_loop_patch">正在对内核打补丁…</string>
+ <string name="fix_recovery_loop_patch_error">对内核打补丁时出错。</string>
<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
<string name="no_kernel_selinux">内核不支持读取 SELinux Context。</string>
@@ -531,9 +558,10 @@
<string name="unable_find_part_path">找不到分区路径 '{1}'</string>
<string name="update_part_details">正在更新分区详情…</string>
<string name="update_part_details_done">…完成</string>
- <string name="wiping_dalvik">正在清除 Dalvik Cache 目录…</string>
+ <string name="wiping_dalvik">正在清除 Dalvik 目录…</string>
<string name="cleaned">已清除:{1}…</string>
- <string name="dalvik_done">-- Dalvik Cache 清除完成!</string>
+ <string name="cache_dalvik_done">-- Dalvik Cache 目录清除完成!</string>
+ <string name="dalvik_done">-- Dalvik 目录清除完成!</string>
<string name="no_andsec">未发现 android secure 分区。</string>
<string name="unable_to_locate">未找到 {1}。</string>
<string name="wiping_datamedia">清除内置存储 -- /data/media…</string>
@@ -600,7 +628,7 @@
<string name="recreate_folder_err">无法重新创建 {1} 文件夹。</string>
<string name="img_size_err">镜像大小大于目标设备</string>
<string name="flashing">正在刷入 {1}…</string>
- <string name="backup_folder">备份文件夹设置为:'{1}'</string>
+ <string name="backup_folder_set">备份文件夹设置为:'{1}'</string>
<string name="locate_backup_err">未找到备份文件 '{1}'</string>
<string name="set_restore_opt">设置恢复选项:'{1}':</string>
<string name="digest_check_skip" version="2">跳过校验 Digest 已开启</string>
diff --git a/gui/theme/extra-languages/languages/zh_TW.xml b/gui/theme/extra-languages/languages/zh_TW.xml
index fc80862c6..fe7cf49d2 100644
--- a/gui/theme/extra-languages/languages/zh_TW.xml
+++ b/gui/theme/extra-languages/languages/zh_TW.xml
@@ -30,6 +30,7 @@
<string name="sdext">SD-EXT</string>
<string name="adopted_data">Adopted Data</string>
<string name="adopted_storage">Adopted 存儲</string>
+ <string name="autostorage">存儲</string>
<!-- GUI XML strings -->
<string name="twrp_header">Team Win Recovery Project</string>
@@ -98,6 +99,7 @@
<string name="install_failed">安裝失敗</string>
<string name="install_successful">安裝成功</string>
<string name="wipe_cache_dalvik_btn">清除 Cache/Dalvik</string>
+ <string name="wipe_dalvik_btn">清除 Dalvik</string>
<string name="reboot_system_btn">重啟系統</string>
<string name="install_sel_target">選擇目標分區</string>
<string name="flash_image_select">選擇要刷入鏡像的分區:</string>
@@ -105,8 +107,10 @@
<string name="flashing_image">正在刷入鏡像…</string>
<string name="image_flashed">鏡像已刷入。</string>
<string name="wipe_cache_dalvik_confirm">是否清除 Cache 和 Dalvik?</string>
+ <string name="wipe_dalvik_confirm">是否清除 Dalvik?</string>
<string name="wiping_cache_dalvik">正在清除 Cache 和 Dalvik…</string>
<string name="wipe_cache_dalvik_complete">Cache 和 Dalvik 清除完成</string>
+ <string name="wipe_dalvik_complete">Dalvik 清除完成</string>
<string name="swipe_wipe">滑動按鈕確認清除</string>
<string name="swipe_wipe_s"> 清除</string>
<string name="no_os1">沒有安裝任何系統!</string>
@@ -318,6 +322,7 @@
<string name="settings_tz_btn">時區</string>
<string name="settings_screen_btn">螢幕</string>
<string name="settings_screen_bright_btn">螢幕亮度</string>
+ <string name="vibration_disabled">振動已在本設備上停用</string>
<string name="settings_vibration_btn">振動</string>
<string name="settings_language_btn">語言</string>
<string name="time_zone_hdr">時區</string>
@@ -480,6 +485,28 @@
<string name="install_cancel">不,以後再說</string>
<string name="sel_storage_list">選擇存儲位置</string>
<string name="ok_btn">確定</string>
+ <string name="install_twrp_ramdisk">安裝 Recovery Ramdisk</string>
+ <string name="install_kernel">安裝內核</string>
+ <string name="repack_kernel_confirm_hdr">安裝內核</string>
+ <string name="repack_ramdisk_confirm_hdr">安裝 Recovery</string>
+ <string name="repack_kernel_confirm">是否安裝內核?</string>
+ <string name="repack_ramdisk_confirm">是否安裝 Recovery?</string>
+ <string name="repack_backup_first">請先備份現有的鏡像</string>
+ <string name="repack">重新打包</string>
+ <string name="swipe_to_install">滑動按鈕確認安裝</string>
+ <string name="installing">正在安裝…</string>
+ <string name="install_complete">安裝完成</string>
+ <string name="unpack_error">解包鏡像錯誤。</string>
+ <string name="repack_error">重新打包鏡像錯誤。</string>
+ <string name="unpacking_image">正在解包 {1}…</string>
+ <string name="repacking_image">正在打包 {1}…</string>
+ <string name="repack_image_hdr">選擇鏡像</string>
+ <string name="fix_recovery_loop">修復 Recovery 無限重啟</string>
+ <string name="fix_recovery_loop_confirm">是否修復 Recovery 無限重啟?</string>
+ <string name="fixing_recovery_loop">正在修復 Recovery 無限重啟…</string>
+ <string name="fix_recovery_loop_complete">Recovery 無限重啟修復完成</string>
+ <string name="fixing_recovery_loop_patch">正在對內核打補丁…</string>
+ <string name="fix_recovery_loop_patch_error">對內核打補丁時出錯。</string>
<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
<string name="no_kernel_selinux">內核不支持讀取 SELinux Context。</string>
@@ -531,9 +558,10 @@
<string name="unable_find_part_path">找不到分區路徑 '{1}'</string>
<string name="update_part_details">正在更新分區詳情…</string>
<string name="update_part_details_done">…完成</string>
- <string name="wiping_dalvik">正在清除 Dalvik Cache 目錄…</string>
+ <string name="wiping_dalvik">正在清除 Dalvik 目錄…</string>
<string name="cleaned">已清除:{1}…</string>
- <string name="dalvik_done">-- Dalvik Cache 清除完成!</string>
+ <string name="cache_dalvik_done">-- Dalvik Cache 目錄清除完成!</string>
+ <string name="dalvik_done">-- Dalvik 目錄清除完成!</string>
<string name="no_andsec">未發現 android secure 分區。</string>
<string name="unable_to_locate">未找到 {1}。</string>
<string name="wiping_datamedia">清除內置存儲 -- /data/media…</string>
@@ -600,7 +628,7 @@
<string name="recreate_folder_err">無法重新創建 {1} 檔案夾。</string>
<string name="img_size_err">鏡像大小大於目標設備</string>
<string name="flashing">正在刷入 {1}…</string>
- <string name="backup_folder">備份檔案夾設置為:'{1}'</string>
+ <string name="backup_folder_set">備份檔案夾設置為:'{1}'</string>
<string name="locate_backup_err">未找到備份檔案 '{1}'</string>
<string name="set_restore_opt">設置恢復選項:'{1}':</string>
<string name="digest_check_skip" version="2">跳過校驗 Digest 已開啟</string>
diff --git a/minui/Android.mk b/minui/Android.mk
index ddec62bf9..824eec659 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -32,7 +32,11 @@ ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
LOCAL_CFLAGS += -DMSM_BSP
LOCAL_SRC_FILES += graphics_overlay.cpp
ifeq ($(TARGET_PREBUILT_KERNEL),)
- LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ else
+ LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ endif
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
else
ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index 3356402ba..2ca2091e1 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -21,7 +21,11 @@ ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
LOCAL_CFLAGS += -DMSM_BSP
LOCAL_SRC_FILES += graphics_overlay.cpp
ifeq ($(TARGET_PREBUILT_KERNEL),)
- LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ else
+ LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ endif
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
else
ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
diff --git a/orscmd/orscmd.cpp b/orscmd/orscmd.cpp
index fd8172dff..c47c0f67f 100644
--- a/orscmd/orscmd.cpp
+++ b/orscmd/orscmd.cpp
@@ -47,6 +47,12 @@ void print_usage(void) {
printf(" set <variable> [value]\n");
printf(" decrypt <password>\n");
printf(" remountrw\n");
+ printf(" fixperms\n");
+ printf(" mount <path>\n");
+ printf(" unmount <path>\n");
+ printf(" print <value>\n");
+ printf(" mkdir <directory>\n");
+ printf(" reboot [recovery|poweroff|bootloader|download|edl]\n");
printf("\nSee more documentation at https://twrp.me/faq/openrecoveryscript.html\n");
}
diff --git a/partition.cpp b/partition.cpp
index 5a1759a34..5d4e61dc0 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -2080,13 +2080,19 @@ bool TWPartition::Wipe_EXTFS(string File_System) {
}
if (TWFunc::Path_Exists("/sbin/e2fsdroid")) {
- // Execute e2fsdroid to initialize selinux context
- Command = "e2fsdroid -e -a " + Mount_Point + " " + Actual_Block_Device;
- LOGINFO("e2fsdroid command: %s\n", Command.c_str());
- ret = TWFunc::Exec_Cmd(Command);
- if (ret) {
- gui_msg(Msg(msg::kError, "unable_to_wipe=Unable to wipe {1}.")(Display_Name));
- return false;
+ const string& File_Contexts_Entry = (Mount_Point == "/system_root" ? "/" : Mount_Point);
+ char *secontext = NULL;
+ if (!selinux_handle || selabel_lookup(selinux_handle, &secontext, File_Contexts_Entry.c_str(), S_IFDIR) < 0) {
+ LOGINFO("Cannot lookup security context for '%s'\n", Mount_Point.c_str());
+ } else {
+ // Execute e2fsdroid to initialize selinux context
+ Command = "e2fsdroid -e -S /file_contexts -a " + File_Contexts_Entry + " " + Actual_Block_Device;
+ LOGINFO("e2fsdroid command: %s\n", Command.c_str());
+ ret = TWFunc::Exec_Cmd(Command);
+ if (ret) {
+ gui_msg(Msg(msg::kError, "unable_to_wipe=Unable to wipe {1}.")(Display_Name));
+ return false;
+ }
}
} else {
LOGINFO("e2fsdroid not present\n");
@@ -2473,7 +2479,7 @@ bool TWPartition::Backup_Tar(PartitionSettings *part_settings, pid_t *tar_fork_p
if (!Mount(true))
return false;
- TWFunc::GUI_Operation_Text(TW_BACKUP_TEXT, Backup_Display_Name, "Backing Up");
+ TWFunc::GUI_Operation_Text(TW_BACKUP_TEXT, Backup_Display_Name, gui_parse_text("{@backing}"));
gui_msg(Msg("backing_up=Backing up {1}...")(Backup_Display_Name));
DataManager::GetValue(TW_USE_COMPRESSION_VAR, tar.use_compression);
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 79068f79d..85dc79d36 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -690,6 +690,7 @@ bool TWPartitionManager::Backup_Partition(PartitionSettings *part_settings) {
}
sync();
sync();
+ string Full_Filename = part_settings->Backup_Folder + "/" + part_settings->Part->Backup_FileName;
if (!part_settings->adbbackup && part_settings->generate_digest) {
if (!twrpDigestDriver::Make_Digest(Full_Filename)) {
goto backup_error;
@@ -1550,6 +1551,7 @@ void TWPartitionManager::Update_System_Details(void) {
if ((*iter)->Mount_Point == Get_Android_Root_Path()) {
int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
DataManager::SetValue(TW_BACKUP_SYSTEM_SIZE, backup_display_size);
+ TWFunc::Is_TWRP_App_In_System();
} else if ((*iter)->Mount_Point == "/data" || (*iter)->Mount_Point == "/datadata") {
data_size += (int)((*iter)->Backup_Size / 1048576LLU);
} else if ((*iter)->Mount_Point == "/cache") {
@@ -3088,7 +3090,7 @@ bool TWPartitionManager::Prepare_Repack(const std::string& Source_Path, const st
if (TWFunc::copy_file(Source_Path, destination, 0644))
return false;
}
- std::string command = "cd " + Temp_Folder_Destination + " && /sbin/magiskboot --unpack -h " + Source_Path;
+ std::string command = "cd " + Temp_Folder_Destination + " && /sbin/magiskboot --unpack -h '" + Source_Path +"'";
if (TWFunc::Exec_Cmd(command) != 0) {
LOGINFO("Error unpacking %s!\n", Source_Path.c_str());
gui_msg(Msg(msg::kError, "unpack_error=Error unpacking image."));
@@ -3154,6 +3156,37 @@ bool TWPartitionManager::Repack_Images(const std::string& Target_Image, const st
}
DataManager::SetProgress(1);
TWFunc::removeDir(REPACK_ORIG_DIR, false);
+ if (part->SlotSelect && Repack_Options.Type == REPLACE_RAMDISK) {
+ LOGINFO("Switching slots to flash ramdisk to both partitions\n");
+ string Current_Slot = Get_Active_Slot_Display();
+ if (Current_Slot == "A")
+ Set_Active_Slot("B");
+ else
+ Set_Active_Slot("A");
+ DataManager::SetProgress(.25);
+ if (!PartitionManager.Prepare_Repack(part, REPACK_ORIG_DIR, Repack_Options.Backup_First, gui_lookup("repack", "Repack")))
+ return false;
+ if (TWFunc::copy_file(REPACK_NEW_DIR "ramdisk.cpio", REPACK_ORIG_DIR "ramdisk.cpio", 0644)) {
+ LOGERR("Failed to copy ramdisk\n");
+ return false;
+ }
+ path = REPACK_ORIG_DIR;
+ command = "cd " + path + " && /sbin/magiskboot --repack " + path + "boot.img";
+ if (TWFunc::Exec_Cmd(command) != 0) {
+ gui_msg(Msg(msg::kError, "repack_error=Error repacking image."));
+ return false;
+ }
+ DataManager::SetProgress(.75);
+ std::string file = "new-boot.img";
+ DataManager::SetValue("tw_flash_partition", "/boot;");
+ if (!PartitionManager.Flash_Image(path, file)) {
+ LOGINFO("Error flashing new image\n");
+ return false;
+ }
+ DataManager::SetProgress(1);
+ TWFunc::removeDir(REPACK_ORIG_DIR, false);
+ Set_Active_Slot(Current_Slot);
+ }
TWFunc::removeDir(REPACK_NEW_DIR, false);
return true;
}
diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk
index 4d67e5b77..d33079994 100644
--- a/prebuilt/Android.mk
+++ b/prebuilt/Android.mk
@@ -21,7 +21,15 @@ else
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sh
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0)
+ RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/grep
+ LOCAL_POST_INSTALL_CMD += $(hide) if [ -e "$(TARGET_RECOVERY_ROOT_OUT)/sbin/egrep" ]; then \
+ rm $(TARGET_RECOVERY_ROOT_OUT)/sbin/egrep; fi; ln -sr $(TARGET_RECOVERY_ROOT_OUT)/sbin/grep $(TARGET_RECOVERY_ROOT_OUT)/sbin/egrep; \
+ if [ -e "$(TARGET_RECOVERY_ROOT_OUT)/sbin/fgrep" ]; then \
+ rm $(TARGET_RECOVERY_ROOT_OUT)/sbin/fgrep; fi; ln -sr $(TARGET_RECOVERY_ROOT_OUT)/sbin/grep $(TARGET_RECOVERY_ROOT_OUT)/sbin/fgrep;
RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/toybox
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0)
+ RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dd
+ endif
ifneq ($(wildcard external/zip/Android.mk),)
RELINK_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/zip
endif
@@ -31,6 +39,9 @@ else
ifneq ($(wildcard system/core/libziparchive/Android.bp),)
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/unzip
endif
+ ifneq ($(wildcard external/one-true-awk/Android.bp),)
+ RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/awk
+ endif
endif
endif
RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/pigz
@@ -226,6 +237,10 @@ ifeq ($(TW_INCLUDE_CRYPTO), true)
ifneq ($(wildcard hardware/interfaces/weaver/1.0/Android.bp),)
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.weaver@1.0.so
endif
+ ifneq ($(wildcard hardware/interfaces/confirmationui/1.0/Android.bp),)
+ RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.confirmationui@1.0.so
+ endif
+
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libhardware_legacy.so
else
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libkeymaster1.so
@@ -309,7 +324,11 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/fsck.ntfs
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/mkfs.ntfs
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libntfs-3g.so
- RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse.so
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
+ RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse-lite.so
+ else
+ RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libfuse.so
+ endif
else
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfs-3g
RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/ntfsfix
@@ -526,12 +545,11 @@ endif
ifeq ($(TW_USE_TOOLBOX), true)
include $(CLEAR_VARS)
LOCAL_MODULE := mkshrc_twrp
+ LOCAL_MODULE_STEM := mkshrc
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/etc
LOCAL_SRC_FILES := $(LOCAL_MODULE)
- LOCAL_POST_INSTALL_CMD := \
- $(hide) mv $(TARGET_RECOVERY_ROOT_OUT)/etc/mkshrc_twrp $(TARGET_RECOVERY_ROOT_OUT)/etc/mkshrc
include $(BUILD_PREBUILT)
endif
diff --git a/scripts/language_helper.py b/scripts/language_helper.py
index ae08363cc..9fa956b2d 100644
--- a/scripts/language_helper.py
+++ b/scripts/language_helper.py
@@ -78,7 +78,7 @@ otherdisplay = otherdoc.getElementsByTagName('display')
for disnode in otherdisplay:
if disnode.nodeType == disnode.ELEMENT_NODE:
language.appendChild(disnode)
- otherlang = disnode.firstChild.data
+ otherlang = disnode.firstChild.data.encode("utf-8")
print otherlang
# resources
@@ -128,7 +128,7 @@ for resnode in enres:
resources.appendChild(others)
break
if found == False:
- print "'%s' present in English and not in %s" % (child.attributes['name'].value, otherlang)
+ print "'%s' present in English and not in %s" % (child.attributes['name'].value.encode("utf-8"), otherlang)
notfound_err = "NOT FOUND " + child.toxml()
notfound_comment = doc.createComment(notfound_err)
resources.appendChild(notfound_comment)
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index 7d1b60251..926743850 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -43,8 +43,7 @@ endif
ifeq ($(TW_USE_TOOLBOX), true)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
# These are the only toolbox tools in M. The rest are now in toybox.
- BSD_TOOLS := \
- $(if $(filter $(PLATFORM_SDK_VERSION), 23 24), du)
+ BSD_TOOLS :=
OUR_TOOLS := \
newfs_msdos
@@ -60,9 +59,10 @@ ifeq ($(TW_USE_TOOLBOX), true)
stop
endif
- ifneq (,$(filter $(PLATFORM_SDK_VERSION), 23))
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
BSD_TOOLS += \
dd \
+ du \
OUR_TOOLS += \
df \
@@ -165,6 +165,7 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27; echo $$?),0)
OUR_TOOLS += getevent
LOCAL_C_INCLUDES += $(TWRP_TOOLBOX_PATH)
LOCAL_WHOLE_STATIC_LIBRARIES += libtoolbox_dd
+
ifneq ($(TW_USE_TOOLBOX), true)
OUR_TOOLS += newfs_msdos
endif
@@ -316,6 +317,36 @@ ifneq (,$(filter $(PLATFORM_SDK_VERSION),16 17 18))
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
endif
+ifeq ($(TW_USE_TOOLBOX), true)
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0)
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := dd_twrp
+ LOCAL_MODULE_STEM := dd
+ LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
+ LOCAL_MODULE_TAGS := optional
+ LOCAL_CFLAGS := -include bsd-compatibility.h -DNO_CONV -Wno-unused-parameter
+ LOCAL_C_INCLUDES := system/core/toolbox/upstream-netbsd/include/ system/core/toolbox/upstream-netbsd/bin/dd system/core/toolbox
+
+ LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+
+ LOCAL_SRC_FILES += \
+ upstream-netbsd/bin/dd/args.c \
+ upstream-netbsd/bin/dd/conv.c \
+ upstream-netbsd/bin/dd/dd.c \
+ upstream-netbsd/bin/dd/dd_hostops.c \
+ upstream-netbsd/bin/dd/misc.c \
+ upstream-netbsd/bin/dd/position.c \
+ upstream-netbsd/lib/libc/gen/getbsize.c \
+ upstream-netbsd/lib/libc/gen/humanize_number.c \
+ upstream-netbsd/lib/libc/stdlib/strsuftoll.c \
+ upstream-netbsd/lib/libc/string/swab.c \
+ upstream-netbsd/lib/libutil/raise_default_signal.c
+
+ include $(BUILD_EXECUTABLE)
+ endif
+endif
+
SYMLINKS :=
ALL_TOOLS :=
BSD_TOOLS :=
diff --git a/toybox/Android.mk b/toybox/Android.mk
index c88f360f5..5f6edec3f 100644
--- a/toybox/Android.mk
+++ b/toybox/Android.mk
@@ -189,6 +189,15 @@ LOCAL_SRC_FILES := \
toys/posix/wc.c \
toys/posix/xargs.c
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -eq 26; echo $$?),0)
+# Android 8.0 had some tools in different paths
+LOCAL_SRC_FILES += \
+ toys/pending/dmesg.c
+else
+LOCAL_SRC_FILES += \
+ toys/lsb/dmesg.c
+endif
+
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0)
# there are some conflicts here with AOSP-7.[01] and CM-14.[01]
# the following items have been removed for compatibility
@@ -222,14 +231,6 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?),0)
LOCAL_SRC_FILES += \
toys/pending/xzcat.c
endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -eq 26; echo $$?),0)
-# Android 8.0 had some tools in different paths
-LOCAL_SRC_FILES += \
- toys/pending/dmesg.c
-else
-LOCAL_SRC_FILES += \
- toys/lsb/dmesg.c
-endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
# Android 8.0/8.1 had some tools in different paths
@@ -319,6 +320,7 @@ LOCAL_SRC_FILES += \
endif
LOCAL_CFLAGS += \
+ -std=c99 \
-std=gnu11 \
-Os \
-Wno-char-subscripts \
@@ -330,8 +332,13 @@ LOCAL_CFLAGS += \
-ffunction-sections -fdata-sections \
-fno-asynchronous-unwind-tables \
-toybox_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p;d' $(LOCAL_PATH)/main.c)
-LOCAL_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\"
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
+ toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
+ LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
+else
+ toybox_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p;d' $(LOCAL_PATH)/main.c)
+ LOCAL_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\"
+endif
LOCAL_CLANG := true
@@ -478,18 +485,14 @@ ALL_TOOLS += \
arp \
base64 \
chattr \
- dd \
df \
diff \
- egrep \
- fgrep \
flock \
freeramdisk \
fsfreeze \
fstype \
ftpget \
ftpput \
- grep \
help \
install \
ionice \
@@ -543,7 +546,7 @@ ALL_TOOLS += \
gzip \
gunzip \
zcat
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27; echo $$?),0)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
ALL_TOOLS += \
fmt \
start \
diff --git a/twinstall.cpp b/twinstall.cpp
index 8bbafca30..d659b47b1 100755
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -353,9 +353,9 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
gui_msg("check_for_digest=Checking for Digest file...");
- if (!twrpDigestDriver::Check_File_Digest(Full_Filename)) {
- LOGERR("Aborting zip install: Digest verification failed\n");
- return INSTALL_CORRUPT;
+ if (*path != '@' && !twrpDigestDriver::Check_File_Digest(Full_Filename)) {
+ LOGERR("Aborting zip install: Digest verification failed\n");
+ return INSTALL_CORRUPT;
}
}
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 5b618e2ac..9034a5013 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -1228,4 +1228,23 @@ void TWFunc::check_selinux_support() {
}
}
}
+
+bool TWFunc::Is_TWRP_App_In_System() {
+ if (PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), false)) {
+ string base_path = PartitionManager.Get_Android_Root_Path();
+ if (TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system"))
+ base_path += "/system"; // For devices with system as a root file system (e.g. Pixel)
+ string install_path = base_path + "/priv-app";
+ if (!TWFunc::Path_Exists(install_path))
+ install_path = base_path + "/app";
+ install_path += "/twrpapp";
+ if (TWFunc::Path_Exists(install_path)) {
+ LOGINFO("App found at '%s'\n", install_path.c_str());
+ DataManager::SetValue("tw_app_installed_in_system", 1);
+ return true;
+ }
+ }
+ DataManager::SetValue("tw_app_installed_in_system", 0);
+ return false;
+}
#endif // ndef BUILD_TWRPTAR_MAIN
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index a892e7574..8cea321b5 100755
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -106,6 +106,7 @@ public:
static int stream_adb_backup(string &Restore_Name); // Tell ADB Backup to Stream to TWRP from GUI selection
static std::string get_cache_dir(); // return the cache partition existence
static void check_selinux_support(); // print whether selinux support is enabled to console
+ static bool Is_TWRP_App_In_System(); // Check if the TWRP app is installed in the system partition
private:
static void Copy_Log(string Source, string Destination);
diff --git a/twrpDigestDriver.cpp b/twrpDigestDriver.cpp
index 4023c813d..074b6c3df 100755
--- a/twrpDigestDriver.cpp
+++ b/twrpDigestDriver.cpp
@@ -70,7 +70,7 @@ bool twrpDigestDriver::Check_File_Digest(const string& Filename) {
if (!TWFunc::Path_Exists(digestfile)) {
delete digest;
- if (Filename.find(".zip") == std::string::npos) {
+ if (Filename.find(".zip") == std::string::npos && Filename.find(".map") == std::string::npos) {
gui_msg(Msg(msg::kError, "no_digest_found=No digest file found for '{1}'. Please unselect Enable Digest verification to restore.")(Filename));
} else {
return true;
diff --git a/variables.h b/variables.h
index 779153ce2..76da715da 100644
--- a/variables.h
+++ b/variables.h
@@ -17,7 +17,7 @@
#ifndef _VARIABLES_HEADER_
#define _VARIABLES_HEADER_
-#define TW_MAIN_VERSION_STR "3.3.0"
+#define TW_MAIN_VERSION_STR "3.3.1"
#define TW_VERSION_STR TW_MAIN_VERSION_STR TW_DEVICE_VERSION
#define TW_USE_COMPRESSION_VAR "tw_use_compression"